<?php
require_once '../../Lib/main.php';
try {
	$page = $_REQUEST['page'];
	$start = $_REQUEST['start'];
	$limit = $_REQUEST['limit'];
	
	$productClassDAO = new Dao_ProductClassDAO();
	$listProductClass = $productClassDAO->getProductClassWithoutDelete($start, $limit);
	
	$cnt = $productClassDAO->countProductClassWithoutDelete();
	$arr = array();
	/* @var $productClss Model_ProductClass */
	foreach ($listProductClass as $key => $productClss) {
		$inArr = array();
		$inArr['id'] = $productClss->getId();
		$inArr['name'] = $productClss->getNameClass();
		$inArr['orderIndex'] = $productClss->getOrderIndex();
		$inArr['folder'] = $productClss->getNameClassFolder();
		$inArr['category_name'] = $productClss->getCategoryName();
		$inArr['delStatus'] = $productClss->getDeleteFlgByString();
		$arr[] = $inArr;
	}
	
	echo json_encode(array('success' => true, 'items' => $arr, 'total' => $cnt));
	
} catch (Exception $e) {
	echo json_encode(array('success' => false,'error' => $e->getMessage()));
}


